<template>
  <!-- 暂时没用 -->
  <div class="qr-code-preview">
    <div class="qr-code-container">
      <img :src="qrCodeSrc" :alt="altText" class="qr-code-image" />
      <div class="qr-code-text">{{ previewText }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "QRCodePreview",
  props: {
    // 二维码图片地址
    qrCodeSrc: {
      type: String,
      required: true,
    },
    // 图片alt文本
    altText: {
      type: String,
      default: "扫码预览",
    },
    // 预览文本
    previewText: {
      type: String,
      default: "扫码预览",
    },
  },
};
</script>

<style scoped>
.qr-code-preview {
  display: inline-block;
}

.qr-code-container {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 160px;
}

.qr-code-image {
  width: 128px;
  height: 128px;
  margin-bottom: 8px;
}

.qr-code-text {
  font-size: 14px;
  color: #323232;
  font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .qr-code-container {
    width: 140px;
    padding: 12px;
  }

  .qr-code-image {
    width: 116px;
    height: 116px;
  }

  .qr-code-text {
    font-size: 13px;
  }
}
</style>
